package cn.yunyichina.provider.sb.task;

import cn.yunyichina.provider.sb.service.impl.OutlineServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Calendar;
import java.util.concurrent.atomic.AtomicLong;

/**
 * Created by 15-AK on 2017/9/18.
 */
public class OutlineUploadTask {
    private static Logger logger = LoggerFactory.getLogger(OutMedicalPatientInfoUploadTask.class);

    private final AtomicLong idGen = new AtomicLong();

    public void startUp() {
        long count = idGen.incrementAndGet();
        if (logger.isInfoEnabled()) {
            logger.info("第 " + count + " 次商保完结信息上传开始....................");
        }
        Long statrTime = Calendar.getInstance().getTimeInMillis();
        OutlineServiceImpl outlineService = new OutlineServiceImpl();
        outlineService.uploadOutlineMessage();
        outlineService.uploadOutlineInhospitalMessage();
        Long endTime = Calendar.getInstance().getTimeInMillis();
        if (logger.isInfoEnabled()) {
            logger.info("第 " + count + " 次商保完结信息上传结束 ,耗费时间" + ( endTime - statrTime ) + " Millis");
        }
    }
}
